# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'GradingCategory'
        db.create_table('gradebook_gradingcategory', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('weight', self.gf('django.db.models.fields.FloatField')(default=1.0)),
            ('course', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('number', self.gf('django.db.models.fields.PositiveIntegerField')(blank=True)),
            ('grading', self.gf('django.db.models.fields.CharField')(default='SUM', max_length=20)),
        ))
        db.send_create_signal('gradebook', ['GradingCategory'])

        # Adding model 'GradingSection'
        db.create_table('gradebook_gradingsection', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
            ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('total_points', self.gf('django.db.models.fields.FloatField')(default=10.0)),
            ('section_number', self.gf('django.db.models.fields.PositiveIntegerField')(blank=True)),
        ))
        db.send_create_signal('gradebook', ['GradingSection'])

        # Adding model 'GradingSectionGrade'
        db.create_table('gradebook_gradingsectiongrade', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('section', self.gf('django.db.models.fields.related.ForeignKey')(related_name='grades', to=orm['gradebook.GradingSection'])),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('points', self.gf('django.db.models.fields.FloatField')(default=0.0)),
            ('notes', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('excused', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('gradebook', ['GradingSectionGrade'])

        # Adding model 'ExternalAssignment'
        db.create_table('gradebook_externalassignment', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('title_slug', self.gf('django.db.models.fields.SlugField')(max_length=255, blank=True)),
            ('category', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('category_slug', self.gf('django.db.models.fields.SlugField')(max_length=255, blank=True)),
            ('total_points', self.gf('django.db.models.fields.FloatField')(default=10.0, blank=True)),
            ('course', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('weight', self.gf('django.db.models.fields.FloatField')(default=1.0)),
        ))
        db.send_create_signal('gradebook', ['ExternalAssignment'])

        # Adding unique constraint on 'ExternalAssignment', fields ['title', 'category', 'course']
        db.create_unique('gradebook_externalassignment', ['title', 'category', 'course'])


    def backwards(self, orm):
        # Removing unique constraint on 'ExternalAssignment', fields ['title', 'category', 'course']
        db.delete_unique('gradebook_externalassignment', ['title', 'category', 'course'])

        # Deleting model 'GradingCategory'
        db.delete_table('gradebook_gradingcategory')

        # Deleting model 'GradingSection'
        db.delete_table('gradebook_gradingsection')

        # Deleting model 'GradingSectionGrade'
        db.delete_table('gradebook_gradingsectiongrade')

        # Deleting model 'ExternalAssignment'
        db.delete_table('gradebook_externalassignment')


    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'gradebook.externalassignment': {
            'Meta': {'unique_together': "(('title', 'category', 'course'),)", 'object_name': 'ExternalAssignment'},
            'category': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'category_slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
            'course': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'title_slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
            'total_points': ('django.db.models.fields.FloatField', [], {'default': '10.0', 'blank': 'True'}),
            'weight': ('django.db.models.fields.FloatField', [], {'default': '1.0'})
        },
        'gradebook.gradingcategory': {
            'Meta': {'object_name': 'GradingCategory'},
            'course': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'grading': ('django.db.models.fields.CharField', [], {'default': "'SUM'", 'max_length': '20'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'number': ('django.db.models.fields.PositiveIntegerField', [], {'blank': 'True'}),
            'weight': ('django.db.models.fields.FloatField', [], {'default': '1.0'})
        },
        'gradebook.gradingsection': {
            'Meta': {'object_name': 'GradingSection'},
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'section_number': ('django.db.models.fields.PositiveIntegerField', [], {'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'total_points': ('django.db.models.fields.FloatField', [], {'default': '10.0'})
        },
        'gradebook.gradingsectiongrade': {
            'Meta': {'object_name': 'GradingSectionGrade'},
            'excused': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'points': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),
            'section': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'grades'", 'to': "orm['gradebook.GradingSection']"}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
        }
    }

    complete_apps = ['gradebook']